# # 学生类
# class student:
#     def __init__(self,number,name,age,sex,height,weight,score,adress,phone):
#         self.number = number
#         self.name = name
#         self.age = age
#         self.sex = sex
#         self.height = height
#         self.weight = weight
#         self.score = score
#         self.adress = adress
#         self.phone = phone
#     def study(self,hours):
#         print(f"{self.name},今天学习了{hours}")
#     def game(self,game_name):
#         print(f"{self.name}在玩的游戏的名字是{game_name}")
#     def program(self,lines):
#         print(f"{self.name}写入代码的行数为{lines}")
#     def sum(self,*args):
#         total = sum(args)
#         print(f"{self.name}计算的总和是：{total}")
#         return total
#
# # 车类
# class Car:
#     def __init__(self, model, wheel_count, color, weight, tank_capacity):
#         self.model = model
#         self.wheel_count = wheel_count
#         self.color = color
#         self.weight = weight
#         self.tank_capacity = tank_capacity
#     def run(self, function):
#         print(f"{self.model}正在进行{function}")
# ferrari = Car(
#     model="法拉利F8",
#     wheel_count=4,
#     color="红色",
#     weight=1435,
#     tank_capacity=78
# )
# bmw = Car(
#     model="宝马X5",
#     wheel_count=4,
#     color="白色",
#     weight=2200,
#     tank_capacity=80
# )
# suzuki = Car(
#     model="铃木雨燕",
#     wheel_count=4,
#     color="黄色",
#     weight=1045,
#     tank_capacity=42
# )
# wuling = Car(
#     model="五菱宏光",
#     wheel_count=4,
#     color="银色",
#     weight=1265,
#     tank_capacity=50
# )
# tractor = Car(
#     model="东方红拖拉机",
#     wheel_count=4,
#     color="绿色",
#     weight=3500,
#     tank_capacity=60
# )
# ferrari.run("赛车比赛")
# bmw.run("城市通勤")
# suzuki.run("乡村代步")
# wuling.run("货物运输")
# tractor.run("农田作业")
#
# # 笔记本
# class Laptop:
#     def __init__(self, model, standby_time, color, weight, cpu_model, ram_size, hard_disk_size):
#         self.model = model  # 型号
#         self.standby_time = standby_time  # 待机时间（单位：小时）
#         self.color = color  # 颜色
#         self.weight = weight  # 重量（单位：kg）
#         self.cpu_model = cpu_model  # CPU型号
#         self.ram_size = ram_size  # 内存大小（单位：GB）
#         self.hard_disk_size = hard_disk_size  # 硬盘大小（单位：GB）
#     def play_game(self, game_name):
#         print(f"{self.model}正在运行游戏：《{game_name}》")
#     def do_office_work(self):
#         print(f"{self.model}正在进行办公处理（文档编辑、数据处理等）")
# gaming_laptop = Laptop(
#         model="拯救者Y9000P",
#         standby_time=6,
#         color="黑色",
#         weight=2.5,
#         cpu_model="Intel Core i7-13700H",
#         ram_size=32,
#         hard_disk_size=1024
# )
# office_laptop = Laptop(
#         model="MacBook Air M2",
#         standby_time=18,
#         color="银色",
#         weight=1.24,
#         cpu_model="Apple M2",
#         ram_size=16,
#         hard_disk_size=512
# )
# gaming_laptop.play_game("英雄联盟")
# gaming_laptop.do_office_work()
# office_laptop.play_game("三角洲行动")
# office_laptop.do_office_work()
#
# # 猴子
# class Monkey:
#     def __init__(self, category, gender, fur_color, weight):
#         self.category = category
#         self.gender = gender
#         self.fur_color = fur_color
#         self.weight = weight
#     def make_fire(self, material):
#         print(f"{self.category}用{material}成功生起了火")
#     def learn_things(self, *things):
#         things_str = "、".join(things)
#         print(f"{self.category}学会了：{things_str}")
# golden_monkey = Monkey(
#         category="金丝猴",
#         gender="雄性",
#         fur_color="金黄色",
#         weight=12.5
# )
#
# rhesus_monkey = Monkey(
#         category="猕猴",
#         gender="雌性",
#         fur_color="棕灰色",
#         weight=8.3
# )
# golden_monkey.make_fire("木棍和干树叶")
# golden_monkey.learn_things("使用工具", "识别危险", "采摘果实")
# rhesus_monkey.make_fire("石头摩擦")
# rhesus_monkey.learn_things("模仿人类动作", "攀爬技巧")


# 打电话业务逻辑
# class People:
#     def __init__(self,name,sex,age,remaining_credit,brand,battery_capacity,screen_size,max_standby_time,points):
#         self.name = name
#         self.sex = sex
#         self.age = age
#         self.remaining_credit = float(remaining_credit)
#         self.brand = brand
#         self.battery_capacity = battery_capacity
#         self.screen_size = screen_size
#         self.max_standby_time = max_standby_time
#         self.points = points
#     def fdx(self,mr):
#         print(f"{self.name}使用{self.brand}手机，发送了一条{mr}短信")
#     def ddh(self,phone_number,time_length):
#         phone_str = str(phone_number).strip()
#         if not phone_str:
#             print("拨打的电话为空号，无法拨通")
#             return 0,0
#         if self.remaining_credit < 1:
#             print("花费余额不足，无法拨通")
#             return 0,0
#         if 0 < time_length <=10:
#            cost = 1.0*time_length
#            add_point = 15.0*time_length
#         elif 10 < time_length <=20:
#            cost = 1.0*10+0.8*(time_length-10)
#            add_point = 15.0*10+39*(time_length-10)
#         else:
#            cost = 1.0*10+10*0.8+0.65*(time_length-20)
#            add_point = 15.0*10+39*10+48*(time_length-20)
#         if cost > self.remaining_credit:
#             print(f"话费不足，当前余额{self.remaining_credit}元，需要{cost:.2f}元")
#             return 0, 0
#             # 更新余额和积分
#         self.remaining_credit -= cost
#         self.points += add_point
#
#         # 格式化输出
#         result = f"花费余额{self.remaining_credit:.2f}, 拥有{self.points}积分"
#         print(f"{self.name}拨打了{phone_str}，通话{time_length}分钟")
#         print(result)
#         return self.remaining_credit, self.points  # 返回数值类型，更便于后续处理
# p1 = People("小明",'男',18,100,'华为',100,6.3,10,0)
# p1.fdx("我快下课了的")
# # p1.ddh(18317698907,15)
# print(p1.ddh(18317698907,15))




























